<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<title>nickLooper</title>

<style>


#boardDiv{
	top:10px;
	left:80px;
	height:400px;
	width:400px;
	padding:0px;
	color:#fff;
}

#boardMigDiv{
	top:10px;
	left:80px;
	height:400px;
	width:400px;
	padding:0px;
	overflow:hidden;
	/*background:#c30 url('images/board00.gif') no-repeat left top;*/
}

#menuArea{
	top:10px;
	left:500px;
	height:180px;
	width:120px;
	padding:10px;
	border:1px solid #000;
	text-align:center;
}

#notes{
	width:120px;
	height:120px;
	padding:10px;
	border:1px solid #000;
	margin:auto;
}

.hiddenDiv{
	visibility:hidden;
}

.X{
	color:#888;
}
.X:hover{
	color:#fa0;
}

input{
	color:#fa0;
	font-size:20px;
	width:50px;
	background-color:#c30;
}

</style>

</head>
<body>

<div style="margin:auto;">

	<div id="holder" style="text-align:center">
<img id="boardMig" style="height:128px;width:128px;" src="">
<p/>
<input type="button" onclick="nextMig(-1)" value="&#9664;">
<input type="button" onclick="nextMig(1)" value="&#9654;">
<p/>
<span class="X" onclick="nextMig(parseInt(document.getElementById('incBy').value));">
increment by </span><input id="incBy" type="text" value="0">
<p/>
<span class="X" onclick="gotoMigNum()">
Go To #</span><input id="gotoInput" type="text" value="297">
<p/>

<div id="notes"></div>

</div>
</div>




<script type="text/javascript">

//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////

var migList = 'mars,neptune,mercury,jupiter,moon'.split(',');


var notes = document.getElementById('notes');
var mig	  = document.getElementById('boardMig');

//+new Date();

//var D = new Date();

//var migCount = parseInt(10e212);
var migCount = 0;
var m = migList.length;

function nextMig(i){

	var old = migCount;
	migCount = migCount + i;

	//  dajewish666
	//migCount = (migCount + m + i) % m;
	//mig.src = 'images/'+ migList[migCount] +'.png';
	var k=migCount;
	var dajew =  (k + k*k*m) % m ;

	//  pizzaface
	var c = migCount;
	//  this works in ALL cases
	//  try to remove one of the mods
	var adjusted = (m + c%m)%m;

	mig.src = 'images/'+ migList[adjusted] +'.png';


	var X = '';

	X += '<br>migCount is ::: ' + migCount;
	X += '<br>dj666 ::: '  + dajew;//dajewish666
	X += '<br>pizza ::: '  + migList[adjusted];//pizzaface
	X += '<br>adjust ::: ' + adjusted;//pizzaface

	notes.innerHTML = X;

};

var gotoMigNum = function(){
	var v = parseInt(document.getElementById('gotoInput').value);
	migCount = v;
	nextMig(0);
};

window.onload = nextMig(0);

</script>
</body>
</html>
